package com.woniuxy.house.web;

import com.woniuxy.house.entity.PageBean;
import com.woniuxy.house.entity.Source;
import com.woniuxy.house.service.ApartmentService;
import com.woniuxy.house.vo.SourceVo;
import com.woniuxy.house.vo.ResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/apartment")
public class ApartmentController {
@Autowired
    private ApartmentService apartmentService;
@RequestMapping("getPage")
/**@魏锦鹏
 * 点击公寓按钮进入公寓界面显示数据
 * 按条件查询公寓数据
 */
    public ResponseEntity getAll(@RequestBody SourceVo apartmentVo){
    PageBean<Source> pageData = apartmentService.getByPage(apartmentVo.getSource()==null?new Source():apartmentVo.getSource(), apartmentVo.getPage() == null ? 1 : apartmentVo.getPage());
    return new ResponseEntity<>("200","success",pageData);
}
}
